package com.menggudf.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
 * 病历实体类
 * @author Administrator
 *
 */
@Entity
@Table(name="caseHistory")
public class CaseHistory implements Serializable{

    /**
     * 
     */
    private static final long serialVersionUID = 1412567970984547796L;
    /**
     * 病历id
     */
    private int    id;//病历id
    /**
     * 病历名称
     */
    private String  historyName;//病历名称
    /**
     * 用户编号
     */
    private String userCode;
    /**
     * 婚姻状况
     */
    private String maritalStatus;
    /**
     * 过敏史
     */
    private String allergicHistory;//过敏史
    /**
     * 现病史
     */
    private String presentIllness;
    /**
     * 既往史
     */
    private String previousHistory;
    /**
     * 个人史
     */
    private String personalHistory;
    /**
     * 家族史
     */
    private String familyHistory;
    /**
     * 婚育史
     */
    private String obstericalHistory;
    /**
     * 体格检查
     */
    private String physicalExamination;
    /**
     * 辅助检查
     */
    private String accessoryExamination;
    /**
     * 初步诊断
     */
    private String primaryDiagnosis;
    /**
     * 处理意见
     */
    private String treatmentSuggestion;
    /**
     * 门诊用药
     */
    private String pharmacy;
    /**
     * 医生姓名
     */
    private String doctorName;
    /**
     * 病历二级密码
     */
    private String secondaryPassword;
    
    
    /**
     * 出生年月
     */
    private String birthDay;
    /**
     * 联系方式
     */
    private String phone;
    /**
     * 病人姓名
     */
    private String username;
    /**
     * 月经史
     */
    private String menstrualHistory;
    /**
     * 职业
     */
    private String profession;
   /**
    * 性别
    */
   private Integer sex;
   
   private Set<ImgUrl> imgUrls = new HashSet<ImgUrl>(0);
    
    @Id
    @Column(name="id",unique=true,nullable=false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    
    @Column(name="userCode",nullable=false)
    public String getUserCode() {
        return userCode;
    }
    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }
    
    @Column(name="maritalStatus")
    public String getMaritalStatus() {
        return maritalStatus;
    }
    public void setMaritalStatus(String maritalStatus) {
        this.maritalStatus = maritalStatus;
    }
    
    @Column(name="allergicHistory")
    public String getAllergicHistory() {
        return allergicHistory;
    }
    public void setAllergicHistory(String allergicHistory) {
        this.allergicHistory = allergicHistory;
    }
    
    @Column(name="presentIllness")
    public String getPresentIllness() {
        return presentIllness;
    }
    public void setPresentIllness(String presentIllness) {
        this.presentIllness = presentIllness;
    }
    
    @Column(name="previousHistory")
    public String getPreviousHistory() {
        return previousHistory;
    }
    public void setPreviousHistory(String previousHistory) {
        this.previousHistory = previousHistory;
    }
    
    @Column(name="personalHistory")
    public String getPersonalHistory() {
        return personalHistory;
    }
    public void setPersonalHistory(String personalHistory) {
        this.personalHistory = personalHistory;
    }
    
    @Column(name="familyHistory")
    public String getFamilyHistory() {
        return familyHistory;
    }
    public void setFamilyHistory(String familyHistory) {
        this.familyHistory = familyHistory;
    }
    
    @Column(name="obstericalHistory")
    public String getObstericalHistory() {
        return obstericalHistory;
    }
    public void setObstericalHistory(String obstericalHistory) {
        this.obstericalHistory = obstericalHistory;
    }
    
    @Column(name="physicalExamination")
    public String getPhysicalExamination() {
        return physicalExamination;
    }
    public void setPhysicalExamination(String physicalExamination) {
        this.physicalExamination = physicalExamination;
    }
    
    @Column(name="accessoryExamination")
    public String getAccessoryExamination() {
        return accessoryExamination;
    }
    public void setAccessoryExamination(String accessoryExamination) {
        this.accessoryExamination = accessoryExamination;
    }
    
    @Column(name="primaryDiagnosis")
    public String getPrimaryDiagnosis() {
        return primaryDiagnosis;
    }
    public void setPrimaryDiagnosis(String primaryDiagnosis) {
        this.primaryDiagnosis = primaryDiagnosis;
    }
    
    @Column(name="treatmentSuggestion")
    public String getTreatmentSuggestion() {
        return treatmentSuggestion;
    }
    public void setTreatmentSuggestion(String treatmentSuggestion) {
        this.treatmentSuggestion = treatmentSuggestion;
    }
    
    @Column(name="pharmacy")
    public String getPharmacy() {
        return pharmacy;
    }
    public void setPharmacy(String pharmacy) {
        this.pharmacy = pharmacy;
    }
    
    @Column(name="doctorName")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    
    @Column(name="secondaryPassword")
    public String getSecondaryPassword() {
        return secondaryPassword;
    }
    public void setSecondaryPassword(String secondaryPassword) {
        this.secondaryPassword = secondaryPassword;
    }
    @Column(name="historyName")
	public String getHistoryName() {
		return historyName;
	}
	public void setHistoryName(String historyName) {
		this.historyName = historyName;
	}
	@Column(name="birthDay" ,length=20)
	public String getBirthDay() {
		return birthDay;
	}
	public void setBirthDay(String birthDay) {
		this.birthDay = birthDay;
	}
	@Column(name="phone")
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	@Column(name="username")
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	@Column(name="menstrualHistory")
	public String getMenstrualHistory() {
		return menstrualHistory;
	}
	public void setMenstrualHistory(String menstrualHistory) {
		this.menstrualHistory = menstrualHistory;
	}
	@Column(name="profession")
	public String getProfession() {
		return profession;
	}
	public void setProfession(String profession) {
		this.profession = profession;
	}
	@Column(name="sex")
	public Integer getSex() {
		return sex;
	}

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "caseHistory")
    public Set<ImgUrl> getImgUrls() {
        return imgUrls;
    }
    public void setImgUrls(Set<ImgUrl> imgUrls) {
        this.imgUrls = imgUrls;
    }
}
